import request from '@/utils/request'

const workFlowPrefix = '/workflow'

const uumsPrefix = '/uums'

const busiPrefix = '/WfBusiDemo'

// 查询
export function wfBusiDemoSelect(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/select',
    method: 'POST',
    data: args
  })
}

// 插入
export function wfBusiDemoInsert(args) {
  return request({
    url: workFlowPrefix + busiPrefix,
    method: 'POST',
    data: args
  })
}

// 更新
export function wfBusiDemoUpdateById(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/' + args.id,
    method: 'PUT',
    data: args
  })
}

// 删除
export function wfBusiDemoDelete(args) {
  return request({
    url: workFlowPrefix + busiPrefix,
    method: 'DELETE',
    data: args
  })
}

// 提交
export function wfBusiDemoSubmit(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/doSubmit',
    method: 'POST',
    data: args
  })
}

// 通过
export function wfBusiDemoPass(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/doPass?id=' + args.id,
    method: 'POST',
    data: args
  })
}

// 单据驳回
export function wfBusiDemoReject(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/doReject?id=' + args.id,
    method: 'POST',
    data: args
  })
}

// 申请人撤回
export function wfBusiDemoApplyWithdraw(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/applyWithdraw?id=' + args.id + '&procInstanceId=' + args.procInstanceId,
    method: 'POST',
    data: args
  })
}

// 抢签
export function wfBusiDemoRushToSign(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/rushToSign?id=' + args.id,
    method: 'POST',
    data: args
  })
}

// 已阅
export function wfBusiDemoRead(args) {
  return request({
    url: workFlowPrefix + busiPrefix + '/doRead?id=' + args.id,
    method: 'POST',
    data: args
  })
}

// 查询系统码表
export function sysCodeListByCodeType(args) {
  return request({
    url: uumsPrefix + '/FreeCertification/SysCodeCommon/getSysCodeList?codeType=' + args.codeType + '&codeStatus=' + args.codeStatus,
    method: 'POST',
    data: args
  })
}
